const express = require('express');
const app = express();

const tedious = require('./tedious.js');
const mssql = require('./mssql.js');
const member = require('./member.js');

app.get('/', (req, res) => {
    var result = { msg: 'Hello World' };
    res.json(result);
});

app.post('/order', tedious.getOrders);
//app.post('/order', mssql.getOrders);
app.post('/order/:listNo', mssql.findByListNo);
app.post('/members', member.getMembers);

var server = app.listen(3000, () => {
    var host = server.address().host;
    var port = server.address().port;

    console.log('Example app listening at http://%s:%s', host, port);
});